occ_labels1910 = 
  read_ipums_ddi("./census_data/ddi_files/usa_00030.xml") %>%
  ipums_val_labels(., var = OCC1950)

police_names <-
  occ_labels1910 %>%
  filter(val %in% c(773)) %>%
  pull(lbl) %>%
  paste0(., sep = ";", collapse = " ")

fire_names <-
  occ_labels1910 %>%
  filter(val %in% c(542, 680, 762)) %>%
  pull(lbl) %>%
  paste0(., sep = ";", collapse = " ")

white_collar_names <-
  occ_labels1910 %>%
  filter(!(val %in% c(773,542, 680, 762, 4, 31, 57, 93)) & val < 500) %>%
  pull(lbl) %>%
  paste0(., sep = ";", collapse = " ")

blue_collar_names <-
  occ_labels1910 %>%
  filter(!(val %in% c(773,542, 680, 762, 4, 31, 57, 93)) & !(val %in% seq(980, 999, 1)) & val > 499) %>%
  pull(lbl) %>%
  paste0(., sep = ";", collapse = " ")


data.frame(police_names, fire_names, white_collar_names, blue_collar_names) %>%
  write.csv(., "./replication_file/_4_data/occ_label.csv")
